package com.aishang.javacv.lab.dao;

import com.aishang.javacv.lab.entity.VideoAddr;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface VideoAddrDao {

    @Insert("insert into video_info values(default, #{name}, #{source}, #{target}, #{prjId}, #{prjName}, default)")
    void insert(VideoAddr videoAddr);

    @Select("select * from video_info where delete_flag='0'")
    List<VideoAddr> getList();

    @Update("update video_info set name = #{name}, source = #{source}, target = #{target}, prj_id = #{prjId}, prj_name = #{prjName}, delete_flag = #{deleteFlag} where id = #{id}")
    void update(VideoAddr videoAddr);

//    @Update("update video_info set delete_flag = '1' where id = #{id}")
//    void delete(Long id);

    @Select("select * from video_info where id = #{id}")
    VideoAddr selectById(Long id);
}
